<table summary="Projects List" id="user_show_projects_list">
  <caption>
    
  </caption>
  <thead>
    <tr>
      <th scope="col">Costcenter</th>
      <th scope="col">Project Title</th>
      <th scope="col">Owner</th>
      <th scope="col">Point</th>
      <th scope="col">GroupName</th>
      <th scope="col">Total Point</th>
      <th scope="col">DateTime</th>
    </tr>
  </thead>

<%  @projects_costcenter.keys.sort.each do |cost_center| %>  

<% for project in @projects_costcenter[cost_center] %>
    <tr id='tr_<%= project.id %>'>
      <td align="left" style="padding-left:15px;"><%= project.costcenter %></td>
      <td align="left" style="padding-left:15px;"><%= link_to project.name,project_path(project) %></td>
      <td align="left" style="padding-left:15px;"><%= project.owner %></td>
      <td style="text-align: center;"><%= project.per_point %></td>
		<td style="text-align: center;"><%= project.group_name %></td>
       <td style="text-align: right;padding-right: 10px;"><%#= project.projectusers.sum(:point) %><%= project.totalpoints %></td>
      <td style="text-align: right;padding-right: 5px;"><%= project.created_at.strftime("%Y-%m-%d") %></td>
    </tr>
  <% end %>
    <tr style="background :#FFFFFF url(/images/bg_sidebar.png) repeat-x scroll left bottom;"><td colspan="6" style="text-align: right;padding-right: 10px;"><b></b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;总计:
    <%=  Project.sum(:totalpoints,{:conditions =>["costcenter=?",cost_center]}) %></td>
    <td style="text-align: right;padding-right: 10px;"></td></tr>
 <% end %>
</table>
<p/>
<div id="pageinate">
  <%= will_paginate @projects %>
</div>
